package com.hellacutty.shake;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends Activity {

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
	}
	public void onClick(View v) {
		Intent i;
		switch (v.getId()) {
		case R.id.play1:
			i = new Intent(getApplicationContext(), CanvasActivity.class);
			startActivity(i);
			break;
		case R.id.play2:
			BluetoothChatService bcs = ((ShakeApplication)getApplication()).getBTService();
			if(bcs == null){
				Toast.makeText(getApplicationContext(), "Please connect a device", Toast.LENGTH_SHORT).show();

			}
			else if(bcs.getState()!=bcs.STATE_CONNECTED){
				Toast.makeText(getApplicationContext(), "Please connect a device", Toast.LENGTH_SHORT).show();
			}
			else{
				i = new Intent(getApplicationContext(), CountdownActivity.class);
				startActivity(i);
			}

			break;
		case R.id.bluetooth_button:
			i = new Intent(getApplicationContext(), BluetoothChat.class);
			startActivity(i);
			break;
		case R.id.instruc:
			i = new Intent(getApplicationContext(), InstrucActivity.class);
			startActivity(i);
			break;
		}
	}
}